<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Test for AmiPro Parser</title>
    <script src="AmiPro.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    var parseTimer;

    function parse() {
        if (parseTimer) {
            window.clearTimeout(parseTimer);
        }
        parseTimer = window.setTimeout(function () {
            var input, output;
            input = document.getElementById('input').value;
            output = AmiPro.parse(input);
            document.getElementById('output').value = JSON.stringify(output, undefined, 2);
            parseTimer = undefined;
        }, 42);
    }
    </script>
<style>
p {
    font-family: 'Droid Sans', Helvetica, Arial, sans-serif;
}

textarea {
    font-family: Monaco, Consolas, "Lucida Console", monospace;
}

#container {
    width: 100%;
}

#left {
    float: left;
    width: 50%;
}

#right {
    float: right;
    width: 45%;
  }

#input {
    border: 1px solid #333;
}

output {
    border: 0px none;
}
</style>
</head>
<body>
  <div id="container">
  <div id="left">
    <p>Type AmiPro file content:</p>
    <p><textarea id="input" cols="70" rows="30" spellcheck="false" onChange='parse()' onKeyDown='parse()'>
[ver]
	4
[sty]
	
[files]
[charset]
	82
	ANSI (Windows, IBM CP 1252)
[revisions]
	0
[prn]
	
[port]
	
[lang]
	7
[fldnames]
	Feld1
	Feld2
	Feld3
	Feld4
	Feld5
	Feld6
	Feld7
	Feld8
[desc]
	
	
	
	
	
	1314826532
	2
	1313996105
	3
	1
	0
	0
	0
	0
	
	
	
	
	
	
	1
[fopts]
	0
	1
	0
	0
	
	
[lnopts]
	2
	Text Abstand
	1
[docopts]
	5
	2
[GramStyle]
	
[tag]
	Text
	2
	[fnt]
		Times New Roman
		240
		0
		49152
	[algn]
		1
		2
		0
		0
		0
	[spc]
		33
		273
		2
		0
		0
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		
		0
		2
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		,
		.
		DM
	Text
	0
	0
[tag]
	Text Abstand
	3
	[fnt]
		Times New Roman
		240
		0
		49152
	[algn]
		1
		2
		0
		0
		0
	[spc]
		33
		277
		2
		0
		277
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		
		0
		2
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		,
		.
		DM
	Text Abstand
	0
	0
[tag]
	Markierung
	4
	[fnt]
		Times New Roman
		240
		0
		49152
	[algn]
		1
		2
		0
		288
		288
	[spc]
		33
		273
		2
		0
		0
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		<*0>
		360
		2
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		,
		.
		DM
	Markierung
	0
	0
[tag]
	Markierung 1
	5
	[fnt]
		Times New Roman
		240
		0
		49152
	[algn]
		1
		2
		288
		288
		288
	[spc]
		33
		273
		2
		0
		0
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		<*5>
		0
		2
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		,
		.
		DM
	Markierung 1
	0
	0
[tag]
	Nr. Liste
	6
	[fnt]
		Times New Roman
		240
		0
		49152
	[algn]
		1
		2
		360
		357
		360
	[spc]
		33
		273
		2
		0
		0
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		<*:>.
		360
		2
		1
		0
		16
		0
		0
	[nfmt]
		272
		1
		2
		,
		.
		DM
	Nr. Liste
	0
	0
[tag]
	Unter Titel
	7
	[fnt]
		Times New Roman
		200
		0
		49155
	[algn]
		1
		2
		0
		0
		0
	[spc]
		33
		273
		2
		72
		72
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		2
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		,
		.
		DM
	Unter Titel
	0
	0
[tag]
	Titel
	8
	[fnt]
		Arial
		360
		0
		16385
	[algn]
		4
		2
		0
		0
		0
	[spc]
		33
		446
		2
		144
		72
		2
		100
	[brk]
		16
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		1
		
		0
		2
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		,
		.
		DM
	Titel
	0
	0
[tag]
	CustomTito
	9
	[fnt]
		Times New Roman
		240
		0
		49152
	[algn]
		1
		2
		0
		0
		0
	[spc]
		33
		273
		2
		0
		0
		2
		100
	[brk]
		4
	[line]
		8
		0
		2
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		
		0
		2
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		,
		.
		DM
	CustomTito
	0
	0
[lay]
	Standard
	516
	[rght]
		16839
		11907
		2
		1440
		1440
		2
		1440
		1440
		0
		1
		0
		1
		0
		2
		1
		1440
		10465
		12
		1
		720
		1
		1440
		1
		2160
		1
		2880
		1
		3600
		1
		4320
		1
		5040
		1
		5760
		1
		6480
		1
		7200
		1
		7920
		1
		8640
	[hrght]
	[lyfrm]
		1
		11200
		0
		0
		11907
		1440
		0
		1
		3
		1 0 0 0 0 0 0
		0
		0
		1
	[frmlay]
		1440
		11907
		1
		1440
		73
		2
		623
		1440
		0
		1
		0
		1
		1
		0
		1
		1440
		10465
		1
		3
		9360
	[txt]
>
	[frght]
	[lyfrm]
		1
		13248
		0
		15399
		11907
		16839
		0
		1
		3
		1 0 0 0 0 0 0
		0
		0
		2
	[frmlay]
		16839
		11907
		1
		1440
		623
		2
		15472
		1440
		0
		1
		0
		1
		1
		0
		1
		1440
		10465
		2
		2
		4680
		3
		9360
	[txt]

>
[elay]
[l1]
	0
[pg]
	1
	13 0 0 1025 0 0 0 65535 65535 Standard	65535 0 0	0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
[edoc]
This is some custom text. It is long enough that the text gets wrapped automatically, it has more than one line and also some extra features to demonstrate some of the formatting, especially some lines where tabs come in handy. This way the PDFs make sense,
 else you couldn't see any visible changes. 


Some text	between this and the first two words is a tabulator

Some text	1,345 - notice that in my example a comma is used for floating numbers

Some text	1200

Some text	text	after second tab	after third tab


This is some custom text. It is long enough that the text gets wrapped automatically, it has more than one line and also some extra features to demonstrate some of the formatting, especially some lines where tabs come in handy. This way the PDFs make sense,
 else you couldn't see any visible changes. 

@CustomTito@This paragraph is formatted with the default values in paragraph style "CustomTito", which resembles the unaltered "Text" style. It is long enough that the text gets wrapped automatically, it has more than one line and also some extra features to demonstrat
e some of the formatting, especially some lines where tabs come in handy. This way the PDFs make sense, else you couldn't see any visible changes. 

This is some custom text. It is long enough that the text gets wrapped automatically, it has more than one line and also some extra features to demonstrate some of the formatting, especially some lines where tabs come in handy. This way the PDFs make sense,
 else you couldn't see any visible changes. 


This is some custom text. It is long enough that the text gets wrapped automatically, it has more than one line and also some extra features to demonstrate some of the formatting, especially some lines where tabs come in handy. This way the PDFs make sense,
 else you couldn't see any visible changes. 


>

[Embedded]
00006060
</textarea></p>
  </div>
  <div id="right">
    <p>Parse result:</p>
    <p><textarea id="output" cols="70" rows="30" readonly></textarea></p>
  </div>
  </div>
  <script>parse();</script>
</body>
</html>
